// pages/comment_details/commentdetails.js
Page({

  /**
   * 页面的初始数据
   */
  data: {
    imgUrl:[
      '../../assets/img/star.jpg',
      '../../assets/img/star.jpg',
      '../../assets/img/star.jpg',
      '../../assets/img/star.jpg',
      '../../assets/img/star.jpg'
    ],
    coverImg:'',
  },

//评分星星
  onClick(e) {
    let curId = e.currentTarget.dataset.id;
    for(var i=0;i<5;i++){
      if(i<=curId){
        this.setData({
          ['imgUrl[' + i + ']']: '../../assets/img/star_active.jpg'
        })
      }else{
        this.setData({
          ['imgUrl[' + i + ']']: '../../assets/img/star.jpg'
        })
      }
    };
  },
  //选择照片
  chooseImg(){
    let that = this;
    wx.chooseImage({
      success: function (res) {
        that.setData({
          coverImg:res.tempFilePaths
        })
      }
    })
  },
  //提交数据
  subed(){
    wx.showToast({
      title: '提交成功',
      // icon: '',
      duration: 2000
    })
  },

  /**
   * 生命周期函数--监听页面加载
   */
  onLoad: function (options) {
  
  },
})